package com.qf.dao;

import com.qf.entity.Product;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;

/**
 * @title:ProducteDao
 * @Descripe:
 * @author:Wjl
 * @date:2023/4/20 14:16
 */
public interface ProductDao {
    //根据条件查询当符合条件的总条数
    Integer DataCount(Integer ps_id, Integer pt_id, String pro_name) throws SQLException;

    //根据条件查询全部的商品(商品类型，商品状态，商品名，当前页和显示数)
    List<Product> selectAllProduct(Integer ps_id, Integer pt_id, String pro_name, Integer currentPageNo, Integer pageSize) throws SQLException;

    //通过id查询单条商品的数据
    Product selectById_Or_Name(Integer pro_id,String pro_name) throws SQLException;

    //添加商品
    int addProduct(String pro_name, String pro_photo, Integer ps_id, Double pro_purchasing_price, Double pro_sale_price, Integer pro_number, Integer pt_id, Date pro_create) throws SQLException;

    //删除商品
    int delProduct(int pro_id) throws SQLException;

    //根据id修改商品
    int updateProduct(Product product) throws SQLException;
}
